<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@include file="../../common/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@include file="../../common/common-css.jsp" %>
<%@include file="../../common/common-js.jsp" %>
<%@include file="../../common/init.jsp" %>
<link rel="stylesheet" type="text/css"
	href="${pageContext.servletContext.contextPath }/css/fenyecss.css" />
	<script type="text/javascript">
function permissio(id){
	 var url = "${pageContext.servletContext.contextPath }/background/resources/permissioRole.html?roleId="+id;
	 var h_sp1 = 400;
	 var w_sp1 = 350;
	//兼容IE，firefox,google.模态窗口居中问题
	 var iTop2 = (window.screen.availHeight - 20 - h_sp1) / 2;
	 var iLeft2 = (window.screen.availWidth - 10 - w_sp1) / 2;
	 var params = 'menubar:no;dialogHeight=' + h_sp1 + 'px;dialogWidth=' + w_sp1 + 'px;dialogLeft=' + iLeft2 + 'px;dialogTop=' + iTop2 + 'px;resizable=yes;scrollbars=0;resizeable=0;center=yes;location:no;status:no;scroll:no'
	 window.showModalDialog(url, window, params);
	 //location.href=url;
}
</script>
	<style type="text/css">
	  input{font-size: 12px}
	</style>
</head>
<body>
<div style="height: 100%;overflow-y: auto;">
<form id="fenye" name="fenye" action="${pageContext.servletContext.contextPath }/background/role/query.html" method="post">
<div class="right" >
        	<div class="volume">
            	<img src="${pageContext.servletContext.contextPath }/images/toleft.png" style="margin:23px 0 0 2px;_margin:23px 0 0 0px;" />
            </div>
        	<div class="rightcon ">
            	<div class="title">
                	您当前的位置：首页 > 角色管理 > 角色列表
                </div>
                  <input type="hidden" name="pageNow" id="pageNow"/>
                <table border="0" cellpadding="0" cellspacing="0" class="table1">
                	<tr>
                    	<td class="odd">角色名：
                        </td>
                        <td class="even"><input type="text" value="${param.name}" name="name" style="height: 20px"/>
                        </td>
                        <td class="odd"  rowspan="2"  >
                        	<div class="button" >
                        	<input type="image" src="${pageContext.servletContext.contextPath }/images/cx.png" width="101" height="46"/>
                        	</div>
                        </td>
                    </tr>
                </table>
                 <table border="0" cellpadding="0" cellspacing="0" class="table2">
                 	<tr class="title">
                        <td width="20%" align="center">
                        	角色名
                        </td>
                         <td width="20%" align="center">
                        	角色KEY
                        </td>
                        <td  width="40%" align="center">
                        	是否禁用
                        </td>
                        <td width="20%" style=" border-right:none;" align="center">
                        	操作
                        </td>
                    </tr>
                   <c:forEach var="role" items="${pageView.records}">
                    <tr class="odd">
                        <td align="center">
                        	${role.name}
                         <td align="center">
                        	${role.roleKey}
                        </td>
                        <td  align="center">
                        	<c:if test="${role.enable eq '0'}">
			            <font color="red">禁用</font>
			            </c:if>
			            <c:if test="${role.enable eq '1'}">
			            <font color="blue">正常</font>
			            </c:if>
                        </td>
                        <td  style=" border-right:none;" align="center">
                        	 <sec:authorize ifAnyGranted="ROLE_sys_role_permissions">
			            	<a href="javascript:void(0);" onclick="permissio('${role.id}')">分配权限</a>&nbsp;&nbsp;&nbsp;&nbsp;
			            </sec:authorize>
			           <%--  <sec:authorize ifAnyGranted="ROLE_sys_role_show">
			            	<a href="${pageContext.servletContext.contextPath }/background/role/getById.html?roleId=${role.id}&&typeKey=1">
			            	详细</a>
			            	&nbsp;&nbsp;</sec:authorize> --%>
			            <sec:authorize ifAnyGranted="ROLE_sys_role_edit">
			            <a href="${pageContext.servletContext.contextPath }/background/role/getById.html?roleId=${role.id}&&typeKey=1">
			                                     编辑
			            </a>
			            &nbsp; &nbsp;</sec:authorize>
			            <sec:authorize ifAnyGranted="ROLE_sys_role_delete">
			            	<a href="javascript:void(0);" onclick="deleteId('${pageContext.servletContext.contextPath }/background/role/deleteById.html?roleId=${role.id}')">
			            	删除</a>
			            	</sec:authorize>
                        </td>
                    </tr>
                    </c:forEach>
                    <tr>
                    <%@include file="../../common/webfenye.jsp" %>
                    </tr>
                 </table>
                
            </div><!--rightcon-->
        </div>
</form>
</div>
</body>
</html>